/**
 * Framework for batch testing user profile models
 * Final project by Sergey Nepomnyachiy and Julia Polchin
 * Supervisor: Tsvi Kuflik
 *
 */
package core.generators;

import interfaces.GeneratorInterface;

import java.util.Collection;
import java.util.Set;
import java.util.TreeSet;

/**
 * Generator of Double sets when given a set of doubles returns a vector of the
 * same doubles
 * 
 * @author Sergey&Julia
 * 
 */
public class StringSetGenerator implements GeneratorInterface<String> {
	protected Set<String> set;

	/**
	 * Set constructor from string with delimiters
	 * 
	 * @param set
	 *            values list delimited by delimiter
	 * @param delimiter
	 *            delimiting sequence of set string
	 * 
	 * 
	 */
	public StringSetGenerator(String set, String delimiter) {
		this.set = new TreeSet<String>();
		for (String s : set.split(delimiter)) {
			this.set.add(s);
		}
	}

	@Override
	public String getScalar() {
		return this.set.iterator().next();
	}

	@Override
	public Collection<String> getVector() {
		return this.set;
	}

	@Override
	public boolean is2D() {
		return false;
	}
}
